#include <stdio.h>
#include <assert.h>
#include "../wc.c"

void test_count_characters() {
    int result = count_characters("tests/sample.txt");
    printf("Testing count_characters... Expected: 1200, Got: %d\n", result);
    assert(result == 1200);
}

void test_count_words() {
    int result = count_words("tests/sample.txt");
    printf("Testing count_words... Expected: 200, Got: %d\n", result);
    assert(result == 200);
}

void test_count_sentences() {
    int result = count_sentences("tests/sample.txt");
    printf("Testing count_sentences... Expected: 15, Got: %d\n", result);
    assert(result == 15);
}

void test_count_lines() {
    int result = count_lines("tests/sample.txt");
    printf("Testing count_lines... Expected: 50, Got: %d\n", result);
    assert(result == 50);
}

void test_count_code_lines() {
    int code_lines = 0, empty_lines = 0, comment_lines = 0;
    count_code_lines("tests/sample.c", &code_lines, &empty_lines, &comment_lines);
    printf("Testing count_code_lines...\n");
    printf("Expected code lines: 50, Got: %d\n", code_lines);
    printf("Expected empty lines: 10, Got: %d\n", empty_lines);
    printf("Expected comment lines: 5, Got: %d\n", comment_lines);
    assert(code_lines == 50);
    assert(empty_lines == 10);
    assert(comment_lines == 5);
}
